from fastapi import APIRouter, Depends

from forward.api.admin.schemas.salesman import (
    SalesmanAddInSchema,
    SalesmanDeleteInSchema,
    SalesmanDetailInSchema,
    SalesmanEditInSchema,
    SalesmanListInSchema,
    SalesmanStatusInSchema,
)
from forward.api.admin.service.salesman import SalesmanService

salesman = APIRouter(prefix="/salesman")


@salesman.post("/lists")
async def list(
    list_in: SalesmanListInSchema,
    salesman_service: SalesmanService = Depends(SalesmanService.instance),
):
    return await salesman_service.lists(list_in)


@salesman.post("/add")
async def add(
    add_in: SalesmanAddInSchema,
    salesman_service: SalesmanService = Depends(SalesmanService.instance),
):
    return await salesman_service.add(add_in)


@salesman.post("/delete")
async def delete(
    delete_in: SalesmanDeleteInSchema,
    salesman_service: SalesmanService = Depends(SalesmanService.instance),
):
    return await salesman_service.delete(delete_in)


@salesman.post("/detail")
async def detail(
    detail_in: SalesmanDetailInSchema,
    salesman_service: SalesmanService = Depends(SalesmanService.instance),
):
    return await salesman_service.detail(detail_in)


@salesman.post("/edit")
async def edit(
    edit_in: SalesmanEditInSchema,
    salesman_service: SalesmanService = Depends(SalesmanService.instance),
):
    return await salesman_service.edit(edit_in)


@salesman.post("/status")
async def status(
    status_in: SalesmanStatusInSchema,
    prize_service: SalesmanService = Depends(SalesmanService.instance),
):
    return await prize_service.status(status_in)
